// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import iView from 'iview'
import 'iview/dist/styles/iview.css'
import axios from 'axios'
import qs from 'qs'
import cookies from 'vue-cookies'
axios.defaults.withCredentials = true
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'
Vue.config.productionTip = false
Vue.use(iView)
Vue.use(cookies)
Vue.prototype.$axios = axios
Vue.prototype.$qs = qs
Vue.prototype.$host = 'http://47.107.148.239:8888'
//Vue.prototype.$host = 'http://localhost:8888'
/* eslint-disable no-new */

router.beforeEach((to, from, next) => {
  iView.LoadingBar.start()
  next()
})

router.afterEach(route => {
  iView.LoadingBar.finish()
})

new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})
